package com.company.huisuo.biz.adapter

import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.company.huisuo.biz.fragment.KRoomArtistListFragment
import com.company.huisuo.biz.fragment.KRoomAuraFragment
import com.company.huisuo.biz.fragment.KRoomDanceFragment

/**
 * K房ViewPager
 */
class KRoomViewPagerAdapter(activity: AppCompatActivity) : FragmentStateAdapter(activity) {
    override fun getItemCount(): Int {
        return 3
    }

    override fun createFragment(position: Int): Fragment {
        return when (position) {
            0 -> KRoomArtistListFragment.newInstance()
            1 -> KRoomDanceFragment.newInstance()
            2 -> KRoomAuraFragment.newInstance()
            else -> throw RuntimeException("角标越界了！！")
        }
    }
}